#!/usr/bin/env python
# -*- coding: utf-8 -*-
from socket import *

s = socket()               # Create a socket object
host = "192.168.0.100"     #socket.gethostname() # Get local machine name
port = 8282                # Reserve a port for your service.

print 'Server started!\nWaiting for clients...'

s.bind((host, port))       # Bind to the port
s.listen(5)                # Now wait for client connection.
s, addr = s.accept()       # Establish connection with client.
print 'Got connection from ', addr[0]

while True:
   msg = s.recv(1024)
   print addr[0], ' >> ', msg
   msg = '200OK'  #= raw_input('SERVER >> ')
   s.sendall(msg)
